<?php

include_once "db.php";

class Event
{
    private $event_id;
    private $event_name;
    private $event_date;
    private $description;
    private $chapter_id;

    private $eventfound;

    public function __construct($id)
    {
        global $mysqli;
        $query = "SELECT * FROM Events WHERE EventId = '" . $id . "'";
        $data = $mysqli->query($query);
        if ($data->num_rows != 0)
        {
            $row = $data->fetch_array(MYSQLI_ASSOC);
            $this->event_id = intval($row["EventId"]);
            $this->event_name = $row["Name"];
            $this->event_date = $row["EventDate"];
            $this->description = $row["Description"];
            $this->chapter_id = $row["ChapterId"];
            $eventfound = true;
        } else
        {
            $this->regionfound = false;
        }
    }

    public function getEventId()
    {
        return $this->event_id;
    }

    public function getEventName()
    {
        return $this->event_name;
    }

    public function getEventDate()
    {
        return $this->event_date;
    }

    public function getDescription()
    {
        return $this->description;
    }

    public function getChapterId()
    {
        return $this->chapter_id;
    }

    public function eventFound()
    {
        return $this->event_found;
    }
}

?>